const express = require('express');
const router = express.Router();

router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 100; i++) content.push({
        id: `id${i}`,
        code: `513200${i}`,
        name: `name${i}`,
        dealerCode: `dealerCode${i}`,
        dealerName: `dealerName${i}`,
        uploadDate: '2019-11-19T07:02:58.287Z',
        status: 15591001,
    });

    res.json({
        message: 'ok',
        payload: {
            content,
            totalElements: 40,
        }
    });
});

router.get('/:id', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            id: '001',
            fileName: '513200001',
            uploadName: 'uploadName1',
            uploadDate: '2019-11-19T07:06:01.124Z',
            piAuditDate: '2019-11-19T07:06:01.124Z',
            piAuditName: 'piAuditName1',
            piAuditRemark: 'piAuditRemark1',
            details: [
                {
                    id: 'id001',
                    claimOrder: 'claimOrder1',
                    partCode: 'partCode1',
                    partName: 'partName1',
                    isMainPart: true,
                    quantity: 123214,
                    partPrice: 46546,
                    partAmountSum: 654654,
                    manageFeeSum: 3133,
                    laborAmountSum: 21421,
                    materialAmountSum: 5454,
                    totalFee: 5474767,
                    vin: 'vin123',
                    series: 'series1'
                },
                {
                    id: 'id002',
                    claimOrder: 'claimOrder2',
                    partCode: 'partCode2',
                    partName: 'partName2',
                    isMainPart: false,
                    quantity: 123214,
                    partPrice: 46546,
                    partAmountSum: 654654,
                    manageFeeSum: 3133,
                    laborAmountSum: 21421,
                    materialAmountSum: 5454,
                    totalFee: 5474767,
                    vin: 'vin456',
                    series: 'series2'
                }
            ]
        },
        totalElements: 40,
    });
});

module.exports = router;
